package cn.project.lemontree.dao;

import cn.project.lemontree.bean.Task;
import cn.project.lemontree.bean.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


public interface TeacherDao extends BaseMapper<Teacher> {
    List<Teacher> listPage(@Param("page")int page,
                        @Param("size")int size,
                        @Param("teacherName")String teacherName,
                           @Param("telephone") String telephone);
    int count( @Param("teacherName")String teacherName,@Param("telephone") String telephone);
    int save(Teacher teacher);
    Teacher login(String telephone);
    int update(Teacher teacher);
    List<Object> find();
    Teacher findByid(Integer teacherId);
    Teacher findBytp(String telephone);
    List<Teacher> getAllTeachers();
    List<Teacher> findFreeTeachers();
    @MapKey("teacherId")
    List<Map<String,Object>> findTeachersAndClass(@Param("page")int page,
                                                  @Param("size")int size,
                                                  @Param("teacherName")String teacherName,
                                                  @Param("telephone") String telephone);
}

